/**
 * Created by fangjiahui on 15/12/9.
 * Count Down
 */

//need jquery
// 所有模块都通过 define 来定义
define(function (require, exports, module) {

    // 通过 require 引入依赖
    var $ = jQuery;

    require('jQueryPlugins/jQueryTimer/jquery.countdown')($);

    var _tempalte = '<b>{d<}{dn} and {d>}' + '{hn} {hl}, {mn} {ml}, {sn} {sl}</b>';


    var Time = {
        init: 60,
        countDown: function (showLayer, targetDate, template) {
            //TODO Pour future utiliser
            var template = template || _tempalte;
            if(showLayer) {
                showLayer.countdown({
                    layout: template,
                    until: new Date("12 23,2015 08:22:22"),
                    //until: targetDate,
                });
            }else{
                return false;
            }
        },
    }


    // 通过 exports 对外提供接口
    //exports.doSomething = ...

    // 或者通过 module.exports 提供整个接口
    module.exports = Time;

});